var windowName = "filePicker";
apiready = function(){
    onWindowShow(function () {
    })
    onWindowHide(function () {
    })
    console.log("index page is OK");
    var Page = createVM("#Page",{
        //页面数据
        list:[]
        ,curFile:{}
    },{
        //页面方法
        "init":function () {
            // showLoading()
            getCurFile(this)
            var cur = getLocData("curFile")
            this.curFile = cur;
        },
        'setCurFile': function (index) {
            setLocData("curFile",this.list[index])
            this.curFile = this.list[index];
            goback()
        }
    })

    Page.init()

}
function getCurFile(_this) {
    apiLoad("/app/file/list",{},function (res) {
        logHtml(res)
        _this.list = res.data
    })
}